<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>子元素选择器</title>
    <style>
        .nav a {
            color: red;
        }
        .nav>a {
            text-decoration-line: none;
        }
    </style>
</head>
<body>
    <div class="nav">
        <a href="#">我是儿子,我不仅是红色而且没有下划线</a>
        <p>
            <a href="#">我是孙子,我虽然是红色但是有下划线</a>
        </p>
    </div>]
</body>
</html>